﻿using UnityEngine;
using System.Collections;

public class cameraFollow : MonoBehaviour 
{
	public Transform player;
	public float relativeHeight = 1.0f;
	public float zDistance = 1.0f;
	public float dampSpeed = 50;
	
	
	// Update is called once per frame
	void Update () 
	{
		Vector3 newPos = player.position + new Vector3(0, relativeHeight, - zDistance);
		
		transform.position = Vector3.Lerp(transform.position,newPos, Time.deltaTime * dampSpeed);
	}
}


